﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:uc="clr-namespace:TFSWorkflowControl.TSWA.SL" >        
    <ItemsPanelTemplate x:Key="ItemsPanelTemplate">
        <StackPanel Orientation="Horizontal"
                          VerticalAlignment="Center"
                          HorizontalAlignment="Center"/>
    </ItemsPanelTemplate>
    <DataTemplate x:Key="StateInfo">
        <StackPanel Orientation="Horizontal" Width="Auto">
            <Grid Width="110" Margin="3,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" MinHeight="10"/>
                    <RowDefinition Height="*" MinHeight="10"/>
                    <RowDefinition Height="40" />
                    <RowDefinition MinHeight="10" Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock 
                    Text="{Binding Path=Who}" 
                    Grid.Column="0" 
                    Grid.Row="0" 
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch"                     
                    Margin="1,-3.3,33,0" 
                    FontSize="10" 
                    TextAlignment="Center"
                    Grid.RowSpan="2"/>
                <TextBlock 
                    Text="{Binding Path=DateStr}" 
                    Grid.Column="1" 
                    Grid.Row="1" 
                    HorizontalAlignment="Stretch"                     
                    Margin="1,0,33,-15" 
                    FontSize="9"                     
                    TextAlignment="Center"
                    VerticalAlignment="Center" 
                    FontStyle="Normal"/>
                <TextBlock 
                    Text="{Binding Path=Reason}" 
                    Grid.Column="0" 
                    Grid.Row="3" 
                    HorizontalAlignment="Stretch" 
                    TextAlignment="Center"
                    VerticalAlignment="Center"                     
                    Margin="1,-20,33,0" 
                    FontSize="10"/>
                <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Layer_1" Height="40" Canvas.Left="0" Canvas.Top="0" Grid.Column="0" Grid.Row="2">
                    <Path Canvas.Left="0" Canvas.Top="0" Stretch="Uniform" StrokeThickness="0.5" StrokeLineJoin="Round" Stroke="#FF444444" Data="F1 M 7.41574,32.9125L 84.6913,32.9125L 84.6913,20.9879L 114.532,40.245L 84.6913,59.502L 84.6913,47.5774L 7.41574,47.5774L 7.41574,32.9125 Z ">
                        <Path.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFAFB5B1" Offset="0"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Path.Fill>
                        <Path.Effect>
                            <DropShadowEffect Opacity="0.2" ShadowDepth="3"/>
                        </Path.Effect>
                    </Path>
                </Canvas>
            </Grid>
            <Border Margin="3,7,3,7" Width="Auto" BorderBrush="#FF298CA6" BorderThickness="0.5" CornerRadius="8,8,8,8" Background="{Binding Path=Background}" >
                <Border.Effect>
                    <DropShadowEffect Opacity="0.2" ShadowDepth="3"/>
                </Border.Effect>
                <!--<Border.Background>
                    <LinearGradientBrush StartPoint="0.973096,0.993378" EndPoint="2.57682,0.993378">
                        <LinearGradientBrush.RelativeTransform>
                            <TransformGroup>
                                <SkewTransform CenterX="0.973096" CenterY="0.993378" AngleX="3.69522" AngleY="0"/>
                                <RotateTransform CenterX="0.973096" CenterY="0.993378" Angle="226.848"/>
                            </TransformGroup>
                        </LinearGradientBrush.RelativeTransform>
                        <LinearGradientBrush.GradientStops>
                            <GradientStop 
                                Color="{Binding Path=Color, Mode=OneWay, Converter={StaticResource ColorConverter}}" 
                                Offset="0"/>
                            <GradientStop 
                                Color="#FFFFFFFF" 
                                Offset="1"/>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Border.Background>-->
                <TextBlock 
                    Text="{Binding Path=Name}" 
                    VerticalAlignment="Center" 
                    HorizontalAlignment="Center" 
                    FontWeight="Normal" 
                    FontStretch="Normal" 
                    FontStyle="Normal" 
                    TextAlignment="Center"
                    Margin="3,0,3,0" 
                    FontSize="14"/>
            </Border>
        </StackPanel>
    </DataTemplate>
    <DataTemplate x:Key="GroupInfo">
        <StackPanel Orientation="Vertical">
            <Border 
                Width="Auto" 
                BorderBrush="#FF000000" 
                BorderThickness="0.5,1,0.5,1" 
                Margin="0,0,0,2" 
                Background="{Binding Path=Background}">
                <!--<Border.Background>
                    <SolidColorBrush   Color="{Binding Color}" />
                    <SolidColorBrush Color="Beige" />
                </Border.Background>-->
                <Border>
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#E5FFFFFF" Offset="0"/>
                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="{Binding Path=GroupName}" TextAlignment="Center" Margin="3" HorizontalAlignment="Left"/>
                </Border>
            </Border>         
            <ItemsControl 
                ItemsSource="{Binding Path=StateInfoList}" 
                ItemsPanel="{StaticResource ItemsPanelTemplate}" 
                ItemTemplate="{StaticResource StateInfo}"
                Padding="3,3,3,3"/>
        </StackPanel>
    </DataTemplate>
    
</ResourceDictionary>